

#include "qt/math/randomnumbers/gpurandomnumbers/gpumersennetwister.hpp"


namespace QuantLib {

	void GPURandomNumbers::assignMemory() {

		destroyAssignedMemory();

		// Allocate the memory on the device
		cudaMalloc((void **)&deviceData, _sampleSize*sizeof(float));
	}

	GPURandomNumbers::~GPURandomNumbers() {
		destroyAssignedMemory();
	}

	void GPURandomNumbers::destroyAssignedMemory() {
		cudaFree(deviceData);
	}

	/*void GPURandomNumbers::destroySample() {
		cudaFree(deviceData);
	}*/

	//void testFunc(void)
	//{
	//	PseudoRandom::rsg_type P = PseudoRandom::make_sequence_generator(100,42);
	//	GPURandomNumbersCreatedOnHost<PseudoRandom::rsg_type> g = GPURandomNumbersCreatedOnHost<PseudoRandom::rsg_type>(P,50);
	//}
}